home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
game
/
patch
/
WHDIGamesS-T.lzh
/
TestDrive.lha
/
TestDriveHD
/
Install
next >
Wrap
Text File
|
2002-02-16
|
4KB
|
225 lines
;****************************
(set #sub-dir "data") ;sub directory containing data files
(set #readme-file "readme") ;name of readme file
(set #doc-file "instructions") ;name of instructions file
(set #gamedir "TestDrive")
;****************************
;----------------------------
; Checks if given program is reachable via the path
; if not abort install
; IN: #program - to check
; OUT: -
(procedure P_chkrun
(if
(= 0 (run ("cd SYS:\nWhich %s" #program)))
("")
(abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
)
)
(procedure P_copydir
(copyfiles
(help @copyfiles-help)
(source ("%s:%s" #AD_disk #AD_dir))
(dest (tackon #datadest #AD_dir)
(all)
)
)
)
;****************************
;----------------------------
; open drawer if opendrawer command is available
; #dest - path
(procedure P_OpenDrawer
(if
(= 0 (run "cd SYS:\nWhich opendrawer"))
(run ("opendrawer %s" #dest))
("")
)
)
;----------------------------
; Wait for inserting disk
; IN: #AD_disk - name of disk
; OUT: -
(procedure P_disk
(askdisk
(dest #AD_disk)
(prompt ("\nInsert Disk \"%s\" in any drive !" #AD_disk))
(help @askdisk-help)
)
)
;****************************
(if
(exists #readme-file)
(if
(= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
("")
(run ("SYS:Utilities/More %s" #readme-file))
)
)
(set #program "WHDLoad")
(P_chkrun)
(set @default-dest
(askdir
(prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name #gamedir))
(help @askdir-help)
(default @default-dest)
(disk)
)
)
(set #dest (tackon @default-dest #gamedir))
(if
(exists #dest)
(
(set #choice
(askbool
(prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
(default 1)
(choices "Delete" "Skip")
(help @askbool-help)
)
)
(if
(= #choice 1)
(run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
)
)
)
(makedir #dest
(help @makedir-help)
(infos)
)
;----------------------------
(copyfiles
(help @copyfiles-help)
(source ("%s.slave" #gamedir))
(dest #dest)
)
(set #icon
(askchoice
(prompt "\nWhich icon do you like to install ?\n")
(default 0)
(choices "Normal" "GlowIcon 1" "GlowIcon 2")
(help @askchoice-help)
)
)
(select #icon
(set #icon ("%s.inf" #gamedir))
(set #icon ("%s.glowicon" #gamedir))
(set #icon ("%s.glowicon2" #gamedir))
)
(copyfiles
(help @copyfiles-help)
(source #icon)
(newname ("%s.info" #gamedir))
(dest #dest)
)
(if
(exists #readme-file)
(copyfiles
(help @copyfiles-help)
(source #readme-file)
(dest #dest)
)
)
(if
(exists ("%s.info" #readme-file))
(copyfiles
(help @copyfiles-help)
(source ("%s.info" #readme-file))
(dest #dest)
)
)
(if
(exists #doc-file)
(copyfiles
(help @copyfiles-help)
(source #doc-file)
(dest #dest)
)
)
(if
(exists ("%s.info" #doc-file))
(copyfiles
(help @copyfiles-help)
(source ("%s.info" #doc-file))
(dest #dest)
)
)
(if
(= #sub-dir "")
("")
(
(set #datadest (tackon #dest #sub-dir))
(makedir #datadest
(help @makedir-help)
)
)
)
;----------------------------
(set #AD_disk "TEST DRIVE")
(P_disk)
(set #AD_dir "Cars")
(P_copydir)
(set #AD_dir "Pics")
(P_copydir)
(set #AD_dir "Songs")
(P_copydir)
(set #AD_dir "DEVS")
(P_copydir)
(set #AD_dir "C")
(P_copydir)
(set #AD_dir "S")
(P_copydir)
(set #AD_dir "Sfx")
(P_copydir)
(copyfiles
(help @copyfiles-help)
(source ("%s:HighScores" #AD_disk))
(dest #datadest)
)
(copyfiles
(help @copyfiles-help)
(source ("%s:cars.txt" #AD_disk))
(dest #datadest)
)
; copy cracked executable
(copyfiles
(help @copyfiles-help)
(source "TD")
(dest #datadest)
)
(P_OpenDrawer)
(exit)